Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for more LLM API providers by implementing Qwen and DeepSeek integrations with streaming capabilities. The changes extend the existing LLM factory pattern to support additional OpenAI-compatible APIs and enhance reasoning model support with think tag processing.
- Adds QwenLLM and DeepSeekLLM classes that inherit from OpenAILLM for API compatibility
- Implements streaming generation support across OpenAI, Qwen, and DeepSeek LLMs with reasoning content handling
- Updates the base LLM interface to include abstract generate_stream method
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/memos/llms/qwen.py | New QwenLLM implementation with generate and generate_stream methods |
| src/memos/llms/deepseek.py | New DeepSeekLLM implementation with generate and generate_stream methods |
| src/memos/llms/openai.py | Added generate_stream method to OpenAILLM and AzureLLM classes |
| src/memos/llms/base.py | Added abstract generate_stream method to BaseLLM interface |
| src/memos/configs/llm.py | Added QwenLLMConfig and DeepSeekLLMConfig configurations |
| src/memos/llms/factory.py | Registered new LLM backends in factory mapping |
| tests/llms/test_qwen.py | Comprehensive tests for QwenLLM generate and streaming functionality |
| tests/llms/test_deepseek.py | Comprehensive tests for DeepSeekLLM generate and streaming functionality |
| tests/llms/test_openai.py | Added streaming tests for OpenAI LLM |
| examples/basic_modules/llm.py | Added usage examples for new LLM providers |
| src/memos/templates/mem_reader_prompts.py | Minor language instruction clarification |
| src/memos/llms/ollama.py | Added NotImplementedError stub for generate_stream |
Ki-Seki
approved these changes
Jul 18, 2025
Ki-Seki
approved these changes
Jul 18, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary: (summary)
Fix: #112
Reviewer: @(reviewer)
Checklist: